package com.meteor.user.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fhs.core.trans.vo.TransPojo;
import com.meteor.framework.common.base.AutoEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.Date;

/**
 * 机构管理
 *
 * @author lynn
 * @date 2024/1/03
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("sys_org")
public class SysOrg implements Serializable, TransPojo{

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_UUID)
    private String id;


    @Schema(description = "上级ID")
    private String pid;

    @Schema(description = "机构名称")
    private String name;

    @Schema(description = "排序")
    private Integer sort;

    @Schema(description = "上级名称")
    @TableField(exist = false)
    private String parentName;

    @Schema(description = "层级")
    private Integer level;

    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建时间", hidden = true, readOnly = true)
    private Date createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "更新时间", hidden = true, readOnly = true)
    private Date updateTime;

    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建者", hidden = true, readOnly = true)
    private String createdBy;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "更新者", hidden = true, readOnly = true)
    private String updatedBy;

    @Schema(description = "状态", hidden = true, readOnly = true)
    private Integer status = 1;

    @Version
    @Schema(description = "版本号", hidden = true, readOnly = true)
    @TableField(fill = FieldFill.INSERT)
    private Integer version;

    @TableLogic
    @Schema(description = "删除标记", hidden = true, readOnly = true)
    @TableField(fill = FieldFill.INSERT)
    private Integer deleted;

}